import 'package:boss/models/taste.dart';
import 'package:boss/ui/widget/center_title_app_bar.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:router/annotation.dart';

import 'provider/taste_provider.dart';
import 'widget/taste_browser.dart';

@RouterConfig(PlusTastePage.pageName)
class PlusTastePage extends StatefulWidget {
  static const pageName = '/plusTastePage';

  @Autowired()
  final Taste taste;

  const PlusTastePage({this.taste});

  @override
  _PlusTastePageState createState() => _PlusTastePageState();
}

class _PlusTastePageState extends State<PlusTastePage> {
  @override
  Widget build(BuildContext context) {
    return ChangeNotifierProvider(
      create: (context) => TasteProvider(taste: widget.taste),
      child: Scaffold(
        appBar: CenterTitleAppBar(title: '添加口味'),
        body: TasteBrowser(),
      ),
    );
  }
}
